home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group93b.txt
/
000136_icon-group-sender _Wed Jun 16 08:28:28 1993.msg
< prev
next >
Wrap
Internet Message Format
|
1993-06-16
|
2KB
Received: from owl.CS.Arizona.EDU by cheltenham.CS.Arizona.EDU; Wed, 16 Jun 1993 08:28:28 MST
Received: by owl.cs.arizona.edu; Wed, 16 Jun 1993 08:28:27 MST
Via: uk.ac.manchester.computer-science; Wed, 16 Jun 1993 02:10:46 +0100
From: Steve Holden <steve@dtc.co.uk>
Date: Tue, 15 Jun 93 23:11:44 BST
Message-Id: <1040.9306152211@desktop.desktop.co.uk>
To: icon-group@cs.arizona.edu, goer <@msuinfo,@uchinews:goer@ellis>
Subject: Re: Pattern-Matching Help Request
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
Further to Richard Gorwitz's suggestion that
if line ? (="%From ", tab(many(namechars)), ="@")
then...
be used to pattern-match senders' names, it is also, of course, possible
to handle _particular_ recipients. The simplest way is to define a list
and use that, e.g.:
senders := ["steve","the.happy.hacker",...,"icon-group"]
...
if line ? (="%From",=!senders,="@")
then ...
If you wanted to identify the paricular sender you could change the second
expression in the mutual evaluation to an assignment, as in
if line ? (="%From ", s := =!senders,="@")
It would probably turn out to be efficient to use a set combined with the
Goerwitz technique, as in
senders := set(["steve","the.happy.hacker",...,"icon-group"])
...
if line ? (="%From ",member(senders,s:=tab(many(namechars))),="@")
then ...
One of the valuable features of the Icon language is the ability to enlarge an
expression without changing its result to enhance the actions your code takes.
regards
Steve
+---------------------------------+-------------------------------------+
| Steve Holden, Technical Director| Desktop Connection Limited |
| steve@desktop.co.uk | Manchester Science Park |
|---------------------------------+ Lloyd Street North |
| Publish and be damned. Publish | Manchester England M15 4EN |
| electronically and be heard. | Tel: +44 61 227 9055 Fax: 226 4922 |
+---------------------------------+-------------------------------------+